﻿using System;
using System.ServiceModel.Channels;

namespace CoreEx.ServiceModel
{
    /// <summary>
    /// Represents a class that is capable of creating a service proxy that intercepts
    /// a service contract type and forwards calls to a <see cref="IChannel"/> instance.
    /// </summary>
    public interface IClientServiceProxyFactory
    {        
        /// <summary>
        /// Creates a service contract proxy of the specified type that is used to communicate
        /// with a WCF service. 
        /// </summary>
        /// <param name="serviceType">The service contract type to intercept.</param>
        /// <param name="uri">The <see cref="Uri"/> that represents the service endpoint address.</param>                        
        /// <returns>A service contract proxy.</returns>
        object CreateServiceProxy(Type serviceType, Uri uri);
    }
}
